package com.system.fkjslee.hos;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class AppointmentActivity extends AppCompatActivity implements View.OnClickListener{

    private Button btnID1;
    private Button btnID2;
    private Button btnID3;
    private Button btnID4;
    private Button btnID5;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_appointment);

        initView();
    }

    private void initView() {
        btnID1 = findViewById(R.id.outpatientID1);
        btnID2 = findViewById(R.id.outpatientID2);
        btnID3 = findViewById(R.id.outpatientID3);
        btnID4 = findViewById(R.id.outpatientID4);
        btnID5 = findViewById(R.id.outpatientID5);

        btnID1.setOnClickListener(this);
        btnID2.setOnClickListener(this);
        btnID3.setOnClickListener(this);
        btnID4.setOnClickListener(this);
        btnID5.setOnClickListener(this);
    }

    public void onClick(View v) {
        Intent intent = new Intent(this, ChooseOutpatient.class);
        switch (v.getId()) {
            case R.id.outpatientID1:
                intent.putExtra("id", "1");
                break;
            case R.id.outpatientID2:
                intent.putExtra("id", "2");
                break;
            case R.id.outpatientID3:
                intent.putExtra("id", "3");
                break;
            case R.id.outpatientID4:
                intent.putExtra("id", "4");
                break;
            case R.id.outpatientID5:
                intent.putExtra("id", "5");
                break;
        }
        startActivity(intent);
    }
}
